<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><title>【工具调教】Vim使用速查 | Forgo7ten'blog</title><meta name="keywords" content="工具&amp;环境调教"><meta name="author" content="Forgo7ten"><meta name="copyright" content="Forgo7ten"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Vim速查 ¶  插入模式 ¶     字母 含义     a 在当前字符后插入   i 在当前字符前插入   o 插入新行到后   A 在当前行后插入   I 在当前行前插入   O 插入新行到前     ctrl h 删除上一个字符 ctrl w 删除上一个单词 ctrl u 删除当前一行 ctrl [ 退出编辑模式进入normal模式（代替Esc） gi 快速回到最后一次编辑位置 题外话：l">
<meta property="og:type" content="article">
<meta property="og:title" content="【工具调教】Vim使用速查">
<meta property="og:url" content="https://forgo7ten.github.io/Env/Vim_usage_quick_check/index.html">
<meta property="og:site_name" content="Forgo7ten&#39;blog">
<meta property="og:description" content="Vim速查 ¶  插入模式 ¶     字母 含义     a 在当前字符后插入   i 在当前字符前插入   o 插入新行到后   A 在当前行后插入   I 在当前行前插入   O 插入新行到前     ctrl h 删除上一个字符 ctrl w 删除上一个单词 ctrl u 删除当前一行 ctrl [ 退出编辑模式进入normal模式（代替Esc） gi 快速回到最后一次编辑位置 题外话：l">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://forgo7ten.gitee.io/store/imgs/17.jpg">
<meta property="article:published_time" content="2020-12-31T16:03:00.000Z">
<meta property="article:modified_time" content="2020-12-31T16:03:00.000Z">
<meta property="article:author" content="Forgo7ten">
<meta property="article:tag" content="工具&amp;环境调教">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://forgo7ten.gitee.io/store/imgs/17.jpg"><link rel="shortcut icon" href="/images/favicon.jpg"><link rel="canonical" href="https://forgo7ten.github.io/Env/Vim_usage_quick_check/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//hm.baidu.com"/><link rel="preconnect" href="//www.clarity.ms"/><link rel="preconnect" href="//fonts.googleapis.com" crossorigin=""/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta name="google-site-verification" content="8L0ZjthONyq6-m7FniRTH8A7Bh0x-KOPZbKOcNimnYA"/><meta name="baidu-site-verification" content="code-gjVsyPt7yr"/><link rel="stylesheet" href="/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.css" media="print" onload="this.media='all'"><script>var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?b076845d73a4f28b3c7401b2a0a8a9db";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script><script>(function(c,l,a,r,i,t,y){
    c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
    t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
    y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "9zbibmmffi");</script><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web&amp;display=swap" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/',
  algolia: undefined,
  localSearch: {"path":"search.xml","languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: {"defaultEncoding":2,"translateDelay":0,"msgToTraditionalChinese":"繁","msgToSimplifiedChinese":"簡"},
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":300},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: true,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: {"chs_to_cht":"你已切换为繁体","cht_to_chs":"你已切换为简体","day_to_night":"你已切换为深色模式","night_to_day":"你已切换为浅色模式","bgLight":"#49b1f5","bgDark":"#121212","position":"bottom-left"},
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery@2/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isAnchor: true
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: '【工具调教】Vim使用速查',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-01-01 00:03:00'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 5.4.0"><link rel="alternate" href="/atom.xml" title="Forgo7ten'blog" type="application/atom+xml">
</head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/images/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data is-center"><div class="data-item"><a href="/archives/"><div class="headline">文章</div><div class="length-num">20</div></a></div><div class="data-item"><a href="/tags/"><div class="headline">标签</div><div class="length-num">8</div></a></div><div class="data-item"><a href="/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/atom.xml"><i class="fa-fw fa fa-rss"></i><span> RSS订阅</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fas fa-comment-dots"></i><span> 留言板</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('http://forgo7ten.gitee.io/store/imgs/17.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/">Forgo7ten'blog</a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-compass"></i><span> 目录</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></li><li><a class="site-page child" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></li><li><a class="site-page child" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/atom.xml"><i class="fa-fw fa fa-rss"></i><span> RSS订阅</span></a></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> 友链</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div><div class="menus_item"><a class="site-page" href="/messageboard/"><i class="fa-fw fas fa-comment-dots"></i><span> 留言板</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">【工具调教】Vim使用速查</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2020-12-31T16:03:00.000Z" title="发表于 2021-01-01 00:03:00">2021-01-01</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2020-12-31T16:03:00.000Z" title="更新于 2021-01-01 00:03:00">2021-01-01</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/categories/%E5%B7%A5%E5%85%B7-%E7%8E%AF%E5%A2%83%E8%B0%83%E6%95%99/">工具&amp;环境调教</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">1.9k</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>6分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="【工具调教】Vim使用速查"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h1 id="Vim速查">Vim速查<a class="header-anchor" href="#Vim速查"> ¶ </a></h1>
<h2 id="插入模式">插入模式<a class="header-anchor" href="#插入模式"> ¶ </a></h2>
<table>
<thead>
<tr>
<th style="text-align:center">字母</th>
<th style="text-align:center">含义</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>a</code></td>
<td style="text-align:center">在当前字符<strong>后</strong>插入</td>
</tr>
<tr>
<td style="text-align:center"><code>i</code></td>
<td style="text-align:center">在当前字符<strong>前</strong>插入</td>
</tr>
<tr>
<td style="text-align:center"><code>o</code></td>
<td style="text-align:center">插入新行到后</td>
</tr>
<tr>
<td style="text-align:center"><code>A</code></td>
<td style="text-align:center">在当前行后插入</td>
</tr>
<tr>
<td style="text-align:center"><code>I</code></td>
<td style="text-align:center">在当前行前插入</td>
</tr>
<tr>
<td style="text-align:center"><code>O</code></td>
<td style="text-align:center">插入新行到前</td>
</tr>
</tbody>
</table>
<ul>
<li><code>ctrl h</code> 删除上一个字符</li>
<li><code>ctrl w</code> 删除上一个单词</li>
<li><code>ctrl u</code> 删除当前一行</li>
<li><code>ctrl [</code> 退出编辑模式进入normal模式（代替Esc）</li>
<li><code>gi</code> 快速回到最后一次编辑位置</li>
<li>题外话：linux命令行快捷键：
<ul>
<li>ctrl a 移动到当前行开头</li>
<li>ctrl e 移动到当前行结尾</li>
<li>ctrl b 向前移一位</li>
<li>ctrl f 向后移一位</li>
</ul>
</li>
</ul>
<h2 id="normal模式">normal模式<a class="header-anchor" href="#normal模式"> ¶ </a></h2>
<h3 id="快速移动">快速移动<a class="header-anchor" href="#快速移动"> ¶ </a></h3>
<ul>
<li><code>h</code>（左），<code>j</code>（下），<code>k</code>（上），<code>l</code>（右）</li>
<li>单词之间移动
<ul>
<li><code>w</code>/<code>W</code>移动到下一个word/WORD开头，<code>e</code>移动到尾部</li>
<li><code>b</code>/<code>B</code>移动到上一个word/WORD开头</li>
<li>word是以非空白符分割的单词，WORD是以空白符分割的单词</li>
</ul>
</li>
<li>行间搜索移动
<ul>
<li>使用<code>f&#123;char&#125;</code>移动到char字符上，用<code>t</code>移动到char的前一个字符</li>
<li>可以用分号<code>;</code>/逗号<code>,</code>继续搜下一个/上一个</li>
<li><code>F</code>倒着搜</li>
</ul>
</li>
<li>vim水平移动
<ul>
<li><code>0</code>移动到行首第一个字符，<code>^</code>移动到第一个非空白字符</li>
<li><code>＄</code>移动到行尾，<code>g_</code>移动到行尾非空白字符</li>
</ul>
</li>
<li>vim垂直移动
<ul>
<li>使用<code>()</code>在句子间移动</li>
<li>使用<code>&#123;&#125;</code>在段落间移动</li>
</ul>
</li>
<li>vim页面移动
<ul>
<li><code>gg</code>/<code>G</code>移动到文件的开头/结尾，<code>Ctrl o</code>快速返回</li>
<li><code>H</code>/<code>M</code>/<code>L</code> 移动到屏幕开头/中间/结尾</li>
<li><code>ctrl u</code>/<code>ctrl f</code> 上下翻页，<code>zz</code>将当前行放在屏幕中间</li>
</ul>
</li>
</ul>
<h3 id="增删改查">增删改查<a class="header-anchor" href="#增删改查"> ¶ </a></h3>
<ul>
<li>快速删除
<ul>
<li><code>x</code> 快速删除一个字符
<ul>
<li>删除2个字符 <code>2x</code></li>
</ul>
</li>
<li><code>daw</code> 快速删除一个单词，包含周围空格</li>
<li><code>diw</code> 快速删除一个单词，不包含周围空格</li>
<li><code>dd</code> 删除当前行
<ul>
<li>删除2行 <code>2dd</code></li>
</ul>
</li>
<li><code>dt[R]</code> 从当前删除到<code>[R]</code>字符前</li>
</ul>
</li>
<li>快速修改
<ul>
<li><code>r[R]</code> 将当前光标字符替换成字符<code>[R]</code></li>
<li><code>R[S]</code> 会将其后的字符挨个替换成字符串<code>[S]</code></li>
<li><code>c</code> 删除并进入插入模式
<ul>
<li>同上述的<code>d</code>：<code>caw</code> <code>ciw</code> <code>ct[R]</code></li>
</ul>
</li>
<li><code>C</code> 删除当前光标后整行并进入插入模式</li>
<li><code>s</code> 删除当前光标字符并进入插入模式
<ul>
<li>删除<code>[\d]</code>个字符并…  <code>[\d]s</code></li>
</ul>
</li>
<li><code>S</code> 删除整行并进入插入模式</li>
</ul>
</li>
<li>查询
<ul>
<li><code>/</code> / <code>?</code> 前向搜索、反向搜索</li>
<li><code>n</code>/<code>N</code> 跳转到下一个、上一个匹配</li>
<li><code>*</code>/<code>#</code> 当前单词的前向、后向匹配</li>
</ul>
</li>
</ul>
<h2 id="Visual-可视-模式">Visual(可视)模式<a class="header-anchor" href="#Visual-可视-模式"> ¶ </a></h2>
<ul>
<li>Normal模式下用<code>v</code>进入visual选择</li>
<li>使用<code>V</code>选择行</li>
<li>使用<code>ctrl v</code>进行方块选择</li>
</ul>
<p>选择后可以用<code>d</code>剪贴，或则<code>y</code>复制</p>
<h2 id="命令模式">命令模式<a class="header-anchor" href="#命令模式"> ¶ </a></h2>
<h3 id="substitute替换命令">substitute替换命令<a class="header-anchor" href="#substitute替换命令"> ¶ </a></h3>
<ul>
<li>命令格式 <code>:[range] s[ubstitute]/&#123;pattern&#125;/&#123;string&#125;/[flags]</code>
<ul>
<li><code>[range]</code> 表示范围：<code>10,20</code>表示10-20行，<code>%</code>表示全部</li>
<li><code>[pattern]</code> 想要替换的字符串</li>
<li><code>[string]</code> 替换后文本</li>
<li><code>[flags]</code> 替换的标志
<ul>
<li><code>g</code> 全局范围内执行</li>
<li><code>c</code> 表示确认，可以确认或者拒绝修改</li>
<li><code>n</code> 报告匹配次数 不替换，用来<strong>查询匹配次数</strong></li>
</ul>
</li>
</ul>
</li>
</ul>
<h3 id="命令行执行normal命令">命令行执行normal命令<a class="header-anchor" href="#命令行执行normal命令"> ¶ </a></h3>
<p>格式</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">:normal &lt;<span class="built_in">command</span>&gt;</span><br></pre></td></tr></table></figure>
<p>用途：使用<code>V</code>选中多行，然后<code>:normal I&quot;</code>在每行前面添加<code>&quot;</code></p>
<h2 id="多文件切换">多文件切换<a class="header-anchor" href="#多文件切换"> ¶ </a></h2>
<ul>
<li>打开多文件 <code>:e &#123;FileName&#125;</code></li>
<li>Buffer缓冲区切换
<ul>
<li><code>:ls</code> 列举当前缓冲区</li>
<li><code>:b [num]</code> 跳转到第<code>[num]</code>个缓冲区
<ul>
<li><code>:bpre</code> <code>:bnext</code> <code>:bfirst</code> <code>:blast</code></li>
<li><code>:b [BufferName]</code> + Tab补全</li>
</ul>
</li>
</ul>
</li>
<li>窗口
<ul>
<li>水平分割窗口：<code>&lt;Ctrl w&gt; s</code>  <code>:sp &#123;FileName&#125;</code> 水平分割并打开新窗口</li>
<li>垂直分割窗口：<code>&lt;Ctrl w&gt; v</code>  <code>:vs</code></li>
<li>切换窗口
<ul>
<li><code>&lt;Ctrl w&gt; w</code>  循环切换窗口</li>
<li><code>&lt;Ctrl w&gt; h</code>  切换到左边窗口</li>
<li><code>&lt;Ctrl w&gt; j</code>  切换到下边窗口</li>
<li><code>&lt;Ctrl w&gt; k</code>  切换到上边窗口</li>
<li><code>&lt;Ctrl w&gt; l</code> 切换到下边窗口</li>
</ul>
</li>
<li>移动窗口
<ul>
<li><code>&lt;Ctrl w&gt; H</code>  将当前窗口移动到左边 ，JKL同理</li>
</ul>
</li>
<li>重排窗口
<ul>
<li><code>&lt;Ctrl w&gt; =</code> 使所有窗口等宽等高</li>
<li><code>&lt;Ctrl w&gt; _</code>  最大化活动窗口的高度：<code>[num]&lt;Ctrl w&gt; _</code> 将高度设为<code>[num]</code>行</li>
<li><code>&lt;Ctrl w&gt; |</code>  最大化活动窗口的宽度</li>
</ul>
</li>
</ul>
</li>
<li>Tab(标签页)操作
<ul>
<li><code>tabe[dit] &#123;FileName&#125;</code>  在新标签页打开文件</li>
<li><code>&lt;Ctrl w&gt; T</code>  将当前窗口移动到新标签页</li>
<li><code>tabc[lose]</code> 关闭当前标签页及所有窗口</li>
<li><code>tabo[nly]</code> 保留当前标签页，关闭其他所有标签页</li>
<li><code>tabn[ext]&#123;N&#125;</code> <code>&#123;N&#125;gt</code> 切换到编号为N的标签页</li>
<li><code>tabn[ext]</code> <code>gt</code> 切换到下一个标签页</li>
<li><code>tabp[revious] </code> <code>gT</code> 切换到上一个标签页</li>
</ul>
</li>
</ul>
<h2 id="Vim文本对象">Vim文本对象<a class="header-anchor" href="#Vim文本对象"> ¶ </a></h2>
<ul>
<li><code>[number]&lt;command&gt;[text object]</code> ：格式
<ul>
<li><code>[number]</code> 表示操作次数</li>
<li><code>&lt;command&gt;</code> 命令：<code>d</code>删除，<code>c</code>改变，<code>y</code>复制</li>
<li><code>[text object]</code> 表示要操作的文本对象</li>
</ul>
</li>
<li>文本对象
<ul>
<li><code>iw</code> 当前单词</li>
<li><code>aw</code> 当前单词与当前单词之后的空格</li>
<li><code>is</code> 当前句子，<code>as</code> 同</li>
<li><code>ip</code> 当前段落</li>
<li><code>i +[ ]</code>
<ul>
<li><code>i(</code> 小括号内内容，不包括小括号</li>
<li><code>a(</code> 小括号及小括号内容</li>
<li>类似还有 <code>[]</code> <code>&#123;&#125;</code> <code>&lt;&gt;</code> <code>&quot;&quot;</code> <code>''</code></li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="Vim复制粘贴">Vim复制粘贴<a class="header-anchor" href="#Vim复制粘贴"> ¶ </a></h2>
<ul>
<li>
<p>normal模式下复制粘贴</p>
<ul>
<li>
<p><code>y(yank)</code> 复制</p>
</li>
<li>
<p><code>d</code> 剪贴</p>
</li>
<li>
<p><code>p(put)</code> 粘贴</p>
</li>
<li>
<p>用<code>v(visual)</code>选中要复制的地方，再用d y p</p>
</li>
<li>
<p>配合文本对象</p>
</li>
</ul>
</li>
<li>
<p>insert模式下复制粘贴</p>
</li>
<li>
<p>粘贴代码格式混乱解决办法</p>
<ul>
<li>当设置了<code>autoindent</code>(自动缩进)后，粘贴代码缩进可能会错乱</li>
<li>解决办法：
<ul>
<li>粘贴前使用命令： <code>:set paste</code></li>
<li>粘贴后撤销上一条命令： <code>:set nopaste</code></li>
</ul>
</li>
</ul>
</li>
<li>
<p>寄存器</p>
<ul>
<li>
<p>Vim操作的是vim寄存器，而不是系统剪贴板</p>
</li>
<li>
<p>指定寄存器</p>
<ul>
<li>
<p>使用<code>&quot;&#123;register&#125;</code> 作为前缀 执行 复制剪贴粘贴 命令时，可以指定寄存器</p>
</li>
<li>
<p>不指定默认使用无名寄存器  无名寄存器指定为<code>&quot;&quot;</code>两个双引号</p>
</li>
<li>
<p>示例</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&quot;add	# 剪贴该行至a寄存器</span></span><br><span class="line"><span class="string">&quot;</span>byy	<span class="comment"># 复制该行至b寄存器</span></span><br><span class="line"><span class="string">&quot;ap		# 粘贴a寄存器内容</span></span><br></pre></td></tr></table></figure>
</li>
<li>
<p>常见寄存器</p>
<table>
<thead>
<tr>
<th style="text-align:center">寄存器符号</th>
<th style="text-align:center">含义</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>a-z</code></td>
<td style="text-align:center">有名寄存器</td>
</tr>
<tr>
<td style="text-align:center"><code>&quot;0</code></td>
<td style="text-align:center">复制专用寄存器</td>
</tr>
<tr>
<td style="text-align:center"><code>&quot;+</code></td>
<td style="text-align:center">复制到系统剪贴板</td>
</tr>
<tr>
<td style="text-align:center"><code>%</code></td>
<td style="text-align:center">当前文件名</td>
</tr>
<tr>
<td style="text-align:center"><code>&quot;.</code></td>
<td style="text-align:center">上次插入文本</td>
</tr>
</tbody>
</table>
</li>
<li>
<p>将系统剪贴板与无名寄存器关联</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">set</span> clipboard=unnamed</span><br></pre></td></tr></table></figure>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2 id="Vim宏">Vim宏<a class="header-anchor" href="#Vim宏"> ¶ </a></h2>
<p>宏的使用分为 录制 和 回放</p>
<ul>
<li>录制：
<ul>
<li>使用<code>q&#123;reg&#125;</code>来录制，同时使用<code>q</code>来结束录制</li>
<li>使用<code>q&#123;register&#125;</code>选择要保存的寄存器，把录制的命令保存到其中</li>
</ul>
</li>
<li>回放
<ul>
<li>使用<code>@&#123;rigister&#125;</code> 回放寄存器中保存的一系列命令</li>
</ul>
</li>
</ul>
<h2 id="Vim补全">Vim补全<a class="header-anchor" href="#Vim补全"> ¶ </a></h2>
<table>
<thead>
<tr>
<th style="text-align:center">命令</th>
<th style="text-align:center">补全类型</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><code>Ctrl n</code></td>
<td style="text-align:center"><strong>普通关键字补全</strong>(向下)</td>
</tr>
<tr>
<td style="text-align:center"><code>Ctrl p</code></td>
<td style="text-align:center"><strong>普通关键字补全</strong>(向上)</td>
</tr>
<tr>
<td style="text-align:center"><code>Ctrl x</code> <code>Ctrl f</code></td>
<td style="text-align:center"><strong>文件名补全</strong></td>
</tr>
<tr>
<td style="text-align:center"><code>Ctrl x</code> <code>Ctrl n</code></td>
<td style="text-align:center">当前缓冲区关键字</td>
</tr>
<tr>
<td style="text-align:center"><code>Ctrl x</code> <code>Ctrl i</code></td>
<td style="text-align:center">包含文件关键字</td>
</tr>
<tr>
<td style="text-align:center"><code>Ctrl x</code> <code>Ctrl ]</code></td>
<td style="text-align:center">标签文件关键字</td>
</tr>
<tr>
<td style="text-align:center"><code>Ctrl x</code> <code>Ctrl k</code></td>
<td style="text-align:center">字典查找</td>
</tr>
<tr>
<td style="text-align:center"><code>Ctrl x</code> <code>Ctrl l</code></td>
<td style="text-align:center">整行补全</td>
</tr>
<tr>
<td style="text-align:center"><code>Ctrl x</code> <code>Ctrl o</code></td>
<td style="text-align:center">全能(Omni)补全（可能需要安装插件）</td>
</tr>
</tbody>
</table>
<h1 id="Vim配置">Vim配置<a class="header-anchor" href="#Vim配置"> ¶ </a></h1>
<h2 id="vim配置">vim配置<a class="header-anchor" href="#vim配置"> ¶ </a></h2>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&quot; 主题</span></span><br><span class="line"><span class="string">color desert</span></span><br><span class="line"><span class="string">&quot;</span> 设置行号</span><br><span class="line"><span class="built_in">set</span> number</span><br><span class="line"><span class="string">&quot; 启用代码高亮</span></span><br><span class="line"><span class="string">syntax enable</span></span><br><span class="line"><span class="string">&quot;</span>高亮搜索</span><br><span class="line"><span class="built_in">set</span> hlsearch</span><br></pre></td></tr></table></figure>
<h2 id="Vim映射">Vim映射<a class="header-anchor" href="#Vim映射"> ¶ </a></h2>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">&quot; 主题</span></span><br><span class="line"><span class="string">color desert</span></span><br><span class="line"><span class="string">&quot;</span> 设置行号</span><br><span class="line"><span class="built_in">set</span> number</span><br><span class="line"><span class="string">&quot; 启用代码高亮</span></span><br><span class="line"><span class="string">syntax enable</span></span><br><span class="line"><span class="string">&quot;</span>高亮搜索</span><br><span class="line"><span class="built_in">set</span> hlsearch</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="string">&quot; 修改映射</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">&quot;</span> insert模式 映射</span><br><span class="line"><span class="string">&quot; 修改 jj退出insert模式(替换Esc)</span></span><br><span class="line"><span class="string">inoremap jj &lt;Esc&gt;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">&quot;</span> normal模式 映射</span><br><span class="line"><span class="string">&quot; 修改窗口切换按键</span></span><br><span class="line"><span class="string">noremap &lt;C-h&gt; &lt;C-w&gt;h</span></span><br><span class="line"><span class="string">noremap &lt;C-j&gt; &lt;C-w&gt;j</span></span><br><span class="line"><span class="string">noremap &lt;C-k&gt; &lt;C-w&gt;k</span></span><br><span class="line"><span class="string">noremap &lt;C-l&gt; &lt;C-w&gt;l</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">&quot;</span> <span class="built_in">command</span>命令行模式 映射</span><br><span class="line"><span class="string">&quot; com!</span></span><br></pre></td></tr></table></figure>
</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">Forgo7ten</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="https://forgo7ten.github.io/Env/Vim_usage_quick_check/">https://forgo7ten.github.io/Env/Vim_usage_quick_check/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="https://Forgo7ten.github.io" target="_blank">Forgo7ten'blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"><a class="post-meta__tags" href="/tags/%E5%B7%A5%E5%85%B7-%E7%8E%AF%E5%A2%83%E8%B0%83%E6%95%99/">工具&amp;环境调教</a></div><div class="post_share"><div class="social-share" data-image="http://forgo7ten.gitee.io/store/imgs/17.jpg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><div class="post-reward"><div class="reward-button"><i class="fas fa-qrcode"></i> 打赏</div><div class="reward-main"><ul class="reward-all"><li class="reward-item"><a href="/images/wechat.png" target="_blank"><img class="post-qr-code-img" src="/images/wechat.png" alt="wechat"/></a><div class="post-qr-code-desc">wechat</div></li><li class="reward-item"><a href="/images/alipay.jpg" target="_blank"><img class="post-qr-code-img" src="/images/alipay.jpg" alt="alipay"/></a><div class="post-qr-code-desc">alipay</div></li></ul></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/Env/Linux_environment_configuration_record/"><img class="prev-cover" src="http://forgo7ten.gitee.io/store/imgs/12.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">Linux环境搭建、配置记录(不定时更新)</div></div></a></div><div class="next-post pull-right"><a href="/Env/IDEA_initialization_configuration_and_plugins/"><img class="next-cover" src="http://forgo7ten.gitee.io/store/imgs/5.jpg" onerror="onerror=null;src='/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">【工具调教】IDEA初始化配置 &amp; 插件收集</div></div></a></div></nav><div class="relatedPosts"><div class="headline"><i class="fas fa-thumbs-up fa-fw"></i><span>相关推荐</span></div><div class="relatedPosts-list"><div><a href="/Env/VSCode_self-use_plugin_record/" title="【工具调教】VS Code 自用插件记录"><img class="cover" src="http://forgo7ten.gitee.io/store/imgs/8.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-01-01</div><div class="title">【工具调教】VS Code 自用插件记录</div></div></a></div><div><a href="/Env/IDEA_initialization_configuration_and_plugins/" title="【工具调教】IDEA初始化配置 & 插件收集"><img class="cover" src="http://forgo7ten.gitee.io/store/imgs/5.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-01-01</div><div class="title">【工具调教】IDEA初始化配置 & 插件收集</div></div></a></div><div><a href="/Env/Linux_environment_configuration_record/" title="Linux环境搭建、配置记录(不定时更新)"><img class="cover" src="http://forgo7ten.gitee.io/store/imgs/12.jpg" alt="cover"><div class="content is-center"><div class="date"><i class="far fa-calendar-alt fa-fw"></i> 2021-01-01</div><div class="title">Linux环境搭建、配置记录(不定时更新)</div></div></a></div></div></div><hr/><div id="post-comment"><div class="comment-head"><div class="comment-headline"><i class="fas fa-comments fa-fw"></i><span> 评论</span></div></div><div class="comment-wrap"><div><div id="gitalk-container"></div></div></div></div></div><div class="aside-content" id="aside-content"><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#Vim%E9%80%9F%E6%9F%A5"><span class="toc-number">1.</span> <span class="toc-text">Vim速查</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%8F%92%E5%85%A5%E6%A8%A1%E5%BC%8F"><span class="toc-number">1.1.</span> <span class="toc-text">插入模式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#normal%E6%A8%A1%E5%BC%8F"><span class="toc-number">1.2.</span> <span class="toc-text">normal模式</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%BF%AB%E9%80%9F%E7%A7%BB%E5%8A%A8"><span class="toc-number">1.2.1.</span> <span class="toc-text">快速移动</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%A2%9E%E5%88%A0%E6%94%B9%E6%9F%A5"><span class="toc-number">1.2.2.</span> <span class="toc-text">增删改查</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Visual-%E5%8F%AF%E8%A7%86-%E6%A8%A1%E5%BC%8F"><span class="toc-number">1.3.</span> <span class="toc-text">Visual(可视)模式</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%91%BD%E4%BB%A4%E6%A8%A1%E5%BC%8F"><span class="toc-number">1.4.</span> <span class="toc-text">命令模式</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#substitute%E6%9B%BF%E6%8D%A2%E5%91%BD%E4%BB%A4"><span class="toc-number">1.4.1.</span> <span class="toc-text">substitute替换命令</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%91%BD%E4%BB%A4%E8%A1%8C%E6%89%A7%E8%A1%8Cnormal%E5%91%BD%E4%BB%A4"><span class="toc-number">1.4.2.</span> <span class="toc-text">命令行执行normal命令</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%A4%9A%E6%96%87%E4%BB%B6%E5%88%87%E6%8D%A2"><span class="toc-number">1.5.</span> <span class="toc-text">多文件切换</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Vim%E6%96%87%E6%9C%AC%E5%AF%B9%E8%B1%A1"><span class="toc-number">1.6.</span> <span class="toc-text">Vim文本对象</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Vim%E5%A4%8D%E5%88%B6%E7%B2%98%E8%B4%B4"><span class="toc-number">1.7.</span> <span class="toc-text">Vim复制粘贴</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Vim%E5%AE%8F"><span class="toc-number">1.8.</span> <span class="toc-text">Vim宏</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Vim%E8%A1%A5%E5%85%A8"><span class="toc-number">1.9.</span> <span class="toc-text">Vim补全</span></a></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#Vim%E9%85%8D%E7%BD%AE"><span class="toc-number">2.</span> <span class="toc-text">Vim配置</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#vim%E9%85%8D%E7%BD%AE"><span class="toc-number">2.1.</span> <span class="toc-text">vim配置</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#Vim%E6%98%A0%E5%B0%84"><span class="toc-number">2.2.</span> <span class="toc-text">Vim映射</span></a></li></ol></li></ol></div></div></div></div></main><footer id="footer" style="background-image: url('http://forgo7ten.gitee.io/store/imgs/17.jpg')"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2023 By Forgo7ten</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Hi, welcome to my <a href="https://Forgo7ten.github.io/">blog</a>!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="translateLink" type="button" title="简繁转换">繁</button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><a id="to_comment" href="#post-comment" title="直达评论"><i class="fas fa-comments"></i></a><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">本地搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/js/utils.js"></script><script src="/js/main.js"></script><script src="/js/tw_cn.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.js"></script><script src="https://cdn.jsdelivr.net/npm/instant.page/instantpage.min.js" type="module"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script src="https://cdn.jsdelivr.net/npm/node-snackbar/dist/snackbar.min.js"></script><script src="/js/search/local-search.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"><script>function addGitalkSource () {
  const ele = document.createElement('link')
  ele.rel = 'stylesheet'
  ele.href= 'https://cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.css'
  document.getElementsByTagName('head')[0].appendChild(ele)
}

function loadGitalk () {
  function initGitalk () {
    var gitalk = new Gitalk(Object.assign({
      clientID: '9e01c692fcf5a9e47867',
      clientSecret: '6d5297eda0643a171a9e5510f5ea1c29ad851389',
      repo: 'Forgo7ten.github.io',
      owner: 'Forgo7ten',
      admin: ['Forgo7ten'],
      id: 'faefb2fbe64423e19b4d22e97ed429a6',
      updateCountCallback: commentCount
    },{"language":"en","perPage":20,"distractionFreeMode":true,"pagerDirection":"last","createIssueManually":true}))

    gitalk.render('gitalk-container')
  }

  if (typeof Gitalk === 'function') initGitalk()
  else {
    addGitalkSource()
    getScript('https://cdn.jsdelivr.net/npm/gitalk@latest/dist/gitalk.min.js').then(initGitalk)
  }
}

function commentCount(n){
  let isCommentCount = document.querySelector('#post-meta .gitalk-comment-count')
  if (isCommentCount) {
    isCommentCount.innerHTML= n
  }
}

if ('Gitalk' === 'Gitalk' || !false) {
  if (false) btf.loadComment(document.getElementById('gitalk-container'), loadGitalk)
  else loadGitalk()
} else {
  function loadOtherComment () {
    loadGitalk()
  }
}</script></div><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = true;
POWERMODE.mobile = false;
document.body.addEventListener('input', POWERMODE);
</script><script id="click-show-text" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/click-show-text.min.js" data-mobile="false" data-text="ヾ(≧▽≦*)o 点个收藏叭,(*^▽^*),w(ﾟДﾟ)w,ㄟ(≧◇≦)ㄏ,(/≧▽≦)/点个关注叭,Σ(っ °Д °;)っ,(●ˇ∀ˇ●),( •̀ ω •́ )✧,(*/ω＼*),ヽ(*。&gt;Д&lt;)o゜真的不收藏一下嘛,(～o￣3￣)～,ヽ（≧□≦）ノ" data-fontsize="15px" data-random="false" async="async"></script><script src="https://cdn.jsdelivr.net/npm/pjax/pjax.min.js"></script><script>let pjaxSelectors = ["title","#config-diff","#body-wrap","#rightside-config-hide","#rightside-config-show",".js-pjax"]

var pjax = new Pjax({
  elements: 'a:not([target="_blank"])',
  selectors: pjaxSelectors,
  cacheBust: false,
  analytics: false,
  scrollRestoration: false
})

document.addEventListener('pjax:send', function () {

  // removeEventListener scroll 
  window.tocScrollFn && window.removeEventListener('scroll', window.tocScrollFn)
  window.scrollCollect && window.removeEventListener('scroll', scrollCollect)

  typeof preloader === 'object' && preloader.initLoading()
  document.getElementById('rightside').style.cssText = "opacity: ''; transform: ''"
  
  if (window.aplayers) {
    for (let i = 0; i < window.aplayers.length; i++) {
      if (!window.aplayers[i].options.fixed) {
        window.aplayers[i].destroy()
      }
    }
  }

  typeof typed === 'object' && typed.destroy()

  //reset readmode
  const $bodyClassList = document.body.classList
  $bodyClassList.contains('read-mode') && $bodyClassList.remove('read-mode')

})

document.addEventListener('pjax:complete', function () {
  window.refreshFn()

  document.querySelectorAll('script[data-pjax]').forEach(item => {
    const newScript = document.createElement('script')
    const content = item.text || item.textContent || item.innerHTML || ""
    Array.from(item.attributes).forEach(attr => newScript.setAttribute(attr.name, attr.value))
    newScript.appendChild(document.createTextNode(content))
    item.parentNode.replaceChild(newScript, item)
  })

  GLOBAL_CONFIG.islazyload && window.lazyLoadInstance.update()

  typeof chatBtnFn === 'function' && chatBtnFn()
  typeof panguInit === 'function' && panguInit()

  // google analytics
  typeof gtag === 'function' && gtag('config', '', {'page_path': window.location.pathname});

  // baidu analytics
  typeof _hmt === 'object' && _hmt.push(['_trackPageview',window.location.pathname]);

  typeof loadMeting === 'function' && document.getElementsByClassName('aplayer').length && loadMeting()

  // prismjs
  typeof Prism === 'object' && Prism.highlightAll()

  typeof preloader === 'object' && preloader.endLoading()
})

document.addEventListener('pjax:error', (e) => {
  if (e.request.status === 404) {
    pjax.loadUrl('/404.html')
  }
})</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"scale":1,"hHeadPos":0.5,"vHeadPos":0.618,"jsonPath":"/live2dw/assets/z16.model.json"},"display":{"superSample":2,"width":200,"height":400,"position":"right","hOffset":0,"vOffset":-20},"mobile":{"show":true,"scale":0.5},"react":{"opacityDefault":0.7,"opacityOnHover":0.2},"log":false});</script></body></html>